<template>
  <a-drawer
    width="1000px"
    placement="right"
    :title="title"
    :visible="visible"
    :bodyStyle="{ padding: '1px' }"
    @close="cancel"
  >
    <div class="eip-drawer-body beauty-scroll">
      <a-spin :spinning="spinning">
        <a-row>
          <a-col>
            <a-form-model-item label="连线说明" prop="title">
              <a-input
                v-model="form.remark"
                placeholder="请输入连线说明"
                allow-clear
              />
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-spin>
    </div>
    <div class="eip-drawer-toolbar">
      <a-space>
        <a-button key="back" @click="cancel" :disabled="loading"
          ><a-icon type="close" />取消</a-button
        >
        <a-button key="submit" @click="save" type="primary" :loading="loading"
          ><a-icon type="save" />提交</a-button
        >
      </a-space>
    </div>
  </a-drawer>
</template>

<script>
import XEUtils from "xe-utils";
export default {
  name: "activityLink",
  data() {
    return {
      config: {
        labelCol: { span: 3 },
        wrapperCol: { span: 19 },
      },
      form: { remark: null },
      loading: false,
      spinning: false,
    };
  },

  props: {
    visible: {
      type: Boolean,
      default: false,
    },
    remark: {
      type: String,
    },
    title: {
      type: String,
    },
  },

  mounted() {
    this.initReamrk();
  },

  methods: {
    /**
     *
     */
    initReamrk() {
      if (this.remark) {
        this.form.remark = XEUtils.clone(this.remark, true);
      }
    },
    /**
     * 取消
     */
    cancel() {
      this.$emit("update:visible", false);
    },

    /**
     * 保存
     */
    save() {
      this.$emit("ok", this.form.remark);
      this.cancel();
    },
  },
};
</script>

<style lang="less" scoped></style>
